import nci60.data.protein.Protein

def cProts = Protein.executeQuery('select distinct c.sourceIPI.id from ProteinChromosome c, LeadingProtein l where l.protein=c.sourceIPI and c.chromosome=\'Y\'')
println 'Proteins on Y: '+cProts.size()+'\t'+cProts
Protein.executeQuery('select p.currentProject.name, p.protein.mainId, p.peptide.sequence, p.peptide from PeptideInProtein p where p.peptide.uniqueGroups=true and p.peptide.contaminant=false and p.peptide.reverse=false and p.protein.id in :prots',[prots:cProts]).each{line->
    println line[0..2]
    line[3].experiments.each{exp->
        println '\t'+exp.experiment.name
    }
}